The present invention relates to a method and apparatus for recognizing a pattern such as a character by means of image processing, and more particularly to a method and apparatus for recognizing a continuous brightness value image (hereinafter referred to as gray level image); image received as an image from a television camera or the like without using a quantization process such as binarization.
Character recognition technique has been widely used in practice and is first among other pattern recognition techniques. However, there arise various problems if this technique is applied to general industrial fields. Namely, consider a commonly used optical code reader which aims at reading characters and symbols recorded on a paper. In the industrial application fields, however, characters and symbols are often printed or engraved on various materials so that unevenness in brightness may often occur depending on the lack of printing uniformity or the lighting conditions.
According to a general character recognition method as shown in FIG. 20, an image of an object 155 such as a character is an input to a television camera 1 and quantized into 6 to 8 bits by an analog/digital (A/D) converter 2 to be written in a gray level image memory (not shown). The data in the gray level image memory are subjected to a pre-processing 150 for removing noises generated by the television camera 1 or quantization noises, and subjected to a binarization process 151 for compressing the data amount. In the binarization process 151, the gray level data are converted into two binary values, "0" and "1", relative to a threshold value.
An obtained binary image is subjected to a character derivation process 152 to pick up a character. The derived character or pattern is subjected to a feature parameter extraction process 153 to extract therefrom feature parameters such as positions of unevenness of the pattern and the number of end points of the pattern. The feature parameters are subjected to a recognition process 154 where they are compared with the previously stored standard pattern data to find a pattern which has the largest number of identical points to the feature parameters. The pattern that is found is an output of the recognition process 154. At the binarization process 151 among the above processes, a double peak pattern of the gray level histogram as shown in FIG. 21A (b) can be obtained if the input gray level image is very clear so that a threshold value for the binarization can be readily determined.
An example of a binary image of a character whose line (contour) can be discriminated distinctively from a background, will be described. FIG. 22 illustrates a method of recognizing a relatively simple character pattern (7 segment character). Check areas 1 to 7 (FIG. 22 (b)) are set at particular positions of a binary image 170 (FIG. 22 (a)) to check if a character line is present within each area. In the case shown in FIG. 22, a character line is present (ON) within the areas 1, 3, 4, 5 and 7, whereas a character line is not present (OFF) within the areas 2 and 6. Such an ON/OFF pattern is characteristic only to a character "2" so that the object image can be recognized as "2". A judgement of ON or OFF can be carried out by checking to what extent lines, i.e., in this case white (binary value "1") values, are included within a local check area.
Alternatively, an example of a gray level image which can be descriminated distinctively because of a certain density difference between a background and a character, will be described. For a gray level image 180, as shown in FIG. 23 (a) for example, wherein a character is bright (high density) and the background is dark, a process for obtaining a density histogram in a check area is performed. FIG. 23 (b) shows a density histogram of a check area within which a character line is not present, and FIG. 23 (c) shows a density histogram of a check area within which a character line is present. Such density histograms are obtained for all the check areas 1 to 7 such as shown in FIG. 22. An objective character can be recognized based on the density feature parameters in the check areas, such as:
(1) Is there any bottom in the density distribution (Are there two peaks)?
(2) The sum, average, or dispersion value of densities.
However, the former method which calculates the number of "1" pixels in a check area, poses a problem that an erroneous judgement may be made if a binarization process is not correctly performed due to sensitive response to any breakage in pattern or noises. Further, the latter poses a problem that it becomes difficult to determine a threshold value if illumination is dark and the contrast of a character lowers, similar to the case as shown in FIG. 21A (b). Apart from the above, if there is unevenness in brightness as shown in FIG. 21B, the peaks and bottom of the density histogram become unclear as shown in FIG. 21B (b), resulting in another reason for the difficulty of determining a threshold value. Particularly in the industrial application fields, illumination conditions of an object may vary to thereby cause the brightness distribution to fluctuate up and down considerably. Thus, it becomes difficult to determine a threshold value of binarization. Also, binarization often leads to a broken or broadened line so that erroneous character recognition becomes likely to occur.
As discussed above, a conventional pattern recognition method as well as a character recognition method adheres to a recognition after conversion of a gray level image into a binary image. As a result, it often occurs that a broken or broadened character and pattern cannot be recognized correctly. To recognize it correctly, an apparatus must have a great amount of software and hardware.